package Rank;

import java.util.ArrayList;
import java.util.List;

import Dao.DaoSqlData;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.dictionary.CustomDictionary;

public class insertIntoCustomDictionary {

	public static void sqlDataInsertIntoCustomDicionary(){
		
		List<String> prd_NameList = new ArrayList<String>();
		try {
			prd_NameList = DaoSqlData.getPrdName();
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		if(prd_NameList.size() !=0){
			for(String s:prd_NameList){
				CustomDictionary.insert(s, "g 1024");		
			}
		}
	}
	
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub
		/* 调试
		HanLP.Config.enableDebug(true);
		HanLP.Config.ShowTermNature = false;
		Segment segment = new DijkstraSegment();
		*/	
		//sqlDataInsertIntoCustomDicionary();
		//System.out.println(HanLP.segment("E-DX2S黑色送（双面贴+保险丝）+SJ10"));
		
		
		//String s = "insert into prdt(prd_Name,prd_No,pri) values ('双面贴','801010002','0.001')";
		//boolean b = DaoSqlData.setPrdInfo(s);
		//System.out.println(b);
		
		
				
	}
	
}
